package com.zhentao.api.schedule;

import com.zhentao.api.schedule.fallback.ScheduleClientApiFallback;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.schedule.dto.TaskDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "leadnews-schedule",fallback = ScheduleClientApiFallback.class)
public interface ScheduleClientApi {

    @PostMapping("/api/v1/task/add")
    public ResponseResult addTask(@RequestBody TaskDto taskDto);


    //按照类型和优先级来拉取任务
    @GetMapping("/api/v1/task/poll/{type}/{priority}")
    public ResponseResult poll(@PathVariable("type") int type, @PathVariable("priority")  int priority);
}
